﻿import { Component, ViewChild } from '@angular/core';
import { NavController, NavParams, Nav } from 'ionic-angular';
import { ParkListPage } from '../book-list/park-list';
import { AboutPage } from '../about/about';
import { ParkMapPage } from '../book-shelf/park-map';

/**
 * Generated class for the ParkSidemenuPage page.
 *
 * See https://ionicframework.com/docs/components/#navigation for more info on
 * Ionic pages and navigation.
 */

@Component({
  selector: 'page-park-sidemenu',
  templateUrl: 'park-sidemenu.html',
})
export class ParkSidemenuPage {

  
  @ViewChild(Nav) nav: Nav;

  rootPage: any = ParkListPage;

  pages: Array<{title: string, component: any,icon: string}>;

  constructor(public navCtrl: NavController, public navParams: NavParams) {
  }

  ionViewDidLoad() {
    this.pages=[
      {title:'小说',component:ParkListPage,icon:'book-outline'},
      {title:'我的书架',component:ParkMapPage,icon:'heart-outline'},
      {title:'关于',component:AboutPage,icon:'information-circle-outline'}
    ];
  }
  openPage(page) {
    // Reset the content nav to have just this page
    // we wouldn't want the back button to show in this scenario
    this.nav.setRoot(page.component);
  }
}
